package com.example.front.view;

/**
 * @Description：分页信息类
 * @Author：曹杰克
 * @CreateTime：2024/7/30 16:18
 */
public class PageInfo {
    //当前页数
    private int pageNo;
    //每页大小
    private int pageSzie;
    //总页数
    private int totalPage;
    //总记录数
    private int totalRecord;

    public PageInfo(int pageNo, int pageSzie, int totalRecord) {
        this.pageNo = pageNo;
        this.pageSzie = pageSzie;
        this.totalRecord = totalRecord;
        //计算总页数
        if( this.totalRecord % this.pageSzie == 0){
            this.totalPage = this.totalRecord / this.pageSzie;
        } else {
            this.totalPage = this.totalRecord / this.pageSzie + 1;
        }
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSzie() {
        return pageSzie;
    }

    public void setPageSzie(int pageSzie) {
        this.pageSzie = pageSzie;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getTotalRecord() {
        return totalRecord;
    }

    public void setTotalRecord(int totalRecord) {
        this.totalRecord = totalRecord;
    }
}
